/* GUI CONVERTED from rcshmtc.p (converter v1.75) Thu Jul 19 05:35:25 2001 */
/* rcshmtc.p - Release Management Customer Schedules                    */
/* Copyright 1986-2002 QAD Inc., Carpinteria, CA, USA.                  */
/* All rights reserved worldwide.  This is an unpublished work.         */
/* $Revision: 1.7.1.6 $                                             */
/*V8:ConvertMode=Maintenance                                            */
/* REVISION: 7.3    LAST MODIFIED: 10/12/92           BY: WUG *G462*    */
/* REVISION: 7.3    LAST MODIFIED: 11/07/94           BY: ljm *GO33*    */
/* REVISION: 7.3    LAST MODIFIED: 01/13/95           BY: srk *G0C1*    */
/* REVISION: 7.3    LAST MODIFIED: 03/04/95           BY: jxz *G0GG*    */
/* REVISION: 7.3    LAST MODIFIED: 08/04/95           by: vrn *G0TN*    */

/* REVISION: 8.6E     LAST MODIFIED: 02/23/98   BY: *L007* A. Rahane       */
/* REVISION: 8.6E     LAST MODIFIED: 05/20/98   BY: *K1Q4* Alfred Tan      */
/* REVISION: 8.6E     LAST MODIFIED: 10/04/98   BY: *J314* Alfred Tan      */
/* REVISION: 9.1      LAST MODIFIED: 03/24/00   BY: *N08T* Annasaheb Rahane*/
/* REVISION: 9.1      LAST MODIFIED: 04/13/00   BY: *K250* Surekha Joshi   */
/* REVISION: 9.1      LAST MODIFIED: 08/12/00   BY: *N0KP* myb             */
/* Old ECO marker removed, but no ECO header exists *F0PN*               */
/* $Revision: 1.7.1.6 $  BY: Ellen Borden    DATE: 07/09/01 ECO: *P007* */
/******************************************************************************/
/* All patch markers and commented out code have been removed from the source */
/* code below. For all future modifications to this file, any code which is   */
/* no longer required should be deleted and no in-line patch markers should   */
/* be added.  The ECO marker should only be included in the Revision History. */
/******************************************************************************/

{mfdeclre.i}
{gplabel.i} /* EXTERNAL LABEL INCLUDE */

/* ********** Begin Translatable Strings Definitions ********* */

&SCOPED-DEFINE rcshmtc_p_1 " Measurements "
/* MaxLen: Comment: */

&SCOPED-DEFINE rcshmtc_p_2 "Tare Weight"
/* MaxLen: Comment: */

/* ********** End Translatable Strings Definitions ********* */

/* SHIPPER MAINT SUBPROGRAM */

define input parameter abs_recid as recid.

define buffer abs_mstr_item for abs_mstr.
define variable deassign like mfc_logical.
define variable del-yn like mfc_logical.
define variable i as integer.
define variable sr_item like pt_part.
define variable sr_po_nbr like sod_contr_id format "x(22)".
define variable abs_twt like abs_nwt label {&rcshmtc_p_2}.
define variable l_pr_abs_twt like abs_nwt no-undo.
define variable vLastField as character no-undo.

/* VARIABLE DEFINITIONS FOR gpfile.i */
{gpfilev.i}


/*GUI preprocessor Frame A define */
&SCOPED-DEFINE PP_FRAME_NAME A

FORM /*GUI*/ 
   
 RECT-FRAME       AT ROW 1.4 COLUMN 1.25
 RECT-FRAME-LABEL AT ROW 1   COLUMN 3 NO-LABEL
 SKIP(.1)  /*GUI*/
abs_nwt              colon 20
   abs_wt_um
   abs_twt              colon 20
   abs_gwt              colon 20
   skip(1)
   abs_vol              colon 20
   abs_vol_um
 SKIP(.4)  /*GUI*/
with frame a side-labels width 80 attr-space

    NO-BOX THREE-D /*GUI*/.

 DEFINE VARIABLE F-a-title AS CHARACTER.
 F-a-title = (getFrameTitle("MEASUREMENTS",19)).
 RECT-FRAME-LABEL:SCREEN-VALUE in frame a = F-a-title.
 RECT-FRAME-LABEL:WIDTH-PIXELS in frame a =
  FONT-TABLE:GET-TEXT-WIDTH-PIXELS(
  RECT-FRAME-LABEL:SCREEN-VALUE in frame a + " ", RECT-FRAME-LABEL:FONT).
 RECT-FRAME:HEIGHT-PIXELS in frame a =
  FRAME a:HEIGHT-PIXELS - RECT-FRAME:Y in frame a - 2.
 RECT-FRAME:WIDTH-CHARS IN FRAME a = FRAME a:WIDTH-CHARS - .5. /*GUI*/

/*GUI preprocessor Frame A undefine */
&UNDEFINE PP_FRAME_NAME



/* SET EXTERNAL LABELS */
setFrameLabels(frame a:handle).

/*DETERMINE IF CONTAINER AND LINE CHARGES IS ENABLED */
{cclc.i}

find abs_mstr where recid(abs_mstr) = abs_recid exclusive-lock.

find pt_mstr where pt_part = abs_item no-lock no-error.
if available pt_mstr then do:
   /* THE FOLLOWING IS FOR BOXES AS OPPOSED TO PALLETS */
   abs_vol = max(abs_vol, pt_height * pt_length * pt_width).
end.

{absupack.i "abs_mstr" 26 22 "abs_twt" }
l_pr_abs_twt = abs_twt.

do with frame a
      on endkey undo, leave:

   display
      abs_nwt
      abs_wt_um
      abs_twt
      abs_gwt
      abs_vol
      abs_vol_um.

   update
      abs_twt.

   abs_gwt = abs_gwt - l_pr_abs_twt + abs_twt.
   {abspack.i  "abs_mstr" 26 22 "abs_twt" }

   display abs_gwt.
   if (using_container_charges or using_line_charges)
      and
      can-find(first absd_det where
      absd_abs_id = abs_id
      and absd_shipfrom = abs_shipfrom
      and absd_abs_fld_name = "abs_twt"
      and absd_fld_prompt = yes)
   then do:
      hide frame a.
      vLastField = "abs_twt".
      {gprunmo.i
         &module = "ACL"
         &program = ""rcswbuf.p""
         &param   = """(input yes,
                        input vLastField,
                        input abs_id,
                        input abs_shipfrom)"""}
      view frame a.
   end. /*IF (USING_CONTAINER_CHARGES OR GO-PENDING OR*/

   update abs_vol.
   if (using_container_charges or using_line_charges)
      and
      can-find(first absd_det where
      absd_abs_id = abs_id
      and absd_shipfrom = abs_shipfrom
      and absd_abs_fld_name = "abs_vol"
      and absd_fld_prompt = yes)
   then do:
      hide frame a.
      vLastField = "abs_vol".
      {gprunmo.i
         &module = "ACL"
         &program = ""rcswbuf.p""
         &param   = """(input yes,
                        input vLastField,
                        input abs_id,
                        input abs_shipfrom)"""}
   end. /*IF (USING_CONTAINER_CHARGES OR GO-PENDING OR*/
end.

hide frame a.
